package com.baseframe.topic.mapper;


import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baseframe.topic.entity.SnsTestTopicUser;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

/**

* @description 针对表【sns_test_topic_user(用户参与能测记录表)】的数据库操作Mapper
* @createDate 2023-07-08 20:58:20
* @Entity com.baseframe.user.entity.SnsTestTopicUser
*/
public interface SnsTestTopicUserMapper extends BaseMapper<SnsTestTopicUser> {

    @Select("select sum(stti.award) as result from sns_test_topic_item stti where stti.correct_answer in(select sttu.select_option_id from sns_test_topic_user as sttu where sttu.topic_id = #{topicId});")
    public Integer getResult(@Param("topicId") Long topicId);

}




